package com.heima.article.feign;

import com.heima.apis.article.IArticleClient;
import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: wxw
 * @ClassName: ArticleClient
 * @JdkVersion: JDK1.8
 * @Version: 1.0.0
 * @Since: 2025/2/17 10:04
 * @Description:
 */

@RestController
//@RequestMapping
public class ArticleClient implements IArticleClient {

    @Autowired
    private ApArticleService apArticleService;


    /**
     * 文章的创建和更新
     */
    @Override
    @PostMapping("/api/v1/article/save")
    public ResponseResult saveOrUpdateArticle(@RequestBody ArticleDto dto){
        return apArticleService.saveOrUpdateArticle(dto);
    }
}
